package com.google.code.wicket.auth.component.value.provider.session;

import org.apache.wicket.Session;

/**
 * Provides pseudo-authentication and authorization through a custom session
 * object.
 * 
 * @param <S>
 *            Session type
 * @param <T>
 *            Privilege type
 */
public interface SessionSingleAuthorizationProvider<S extends Session, T>
        extends SessionLoginProvider<S> {

    /**
     * Is the specified privilege available in the current session (i.e. to the
     * current user)? Should only be called when {@link #isLoggedIn(Session)}
     * returns true.
     * 
     * @param session
     * @param privilege
     * @return
     */
    boolean hasPrivilege(S session, T privilege);

}
